package com.java1234.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/** 根据TAG方式过滤消息
 * @author zhaolin
 * @version 1.0
 * @description: TODO 消费端，通过selectorExpression = "TAG1 || TAG2",selectorType = SelectorType.TAG，指定需要消费的TAG
 * @date 2025/2/7 14:21
 */
@RocketMQMessageListener(topic = "java1234-filter-rocketmq",consumerGroup
        ="${rocketmq.consumer.group}" ,selectorExpression = "TAG1 || TAG2",selectorType
        = SelectorType.TAG)
//@Component
public class ConsumerService3 implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("消费者：收到消息内容："+s);
    }
}
